﻿<Page x:Class="WpfEffect.PageDropshadowBitmapEffect"
      xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
      xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
      xmlns:mc="http://schemas.openxmlformats.org/markup-compatibility/2006" 
      xmlns:d="http://schemas.microsoft.com/expression/blend/2008" 
      mc:Ignorable="d" 
      d:DesignHeight="300" d:DesignWidth="800"
	Title="PageDropshadowBitmapEffect">
    <Canvas  >
        <!--投影-->
        <Slider Canvas.Left="100" Canvas.Top="10" Height="22"  Width="312"  Minimum="0" Maximum="30"  AutoToolTipPlacement="BottomRight" 
                Value="{Binding ElementName=effecct,Path=ShadowDepth}"
                AutoToolTipPrecision="1" x:Name="sldShadowDepth" Interval="1"  LargeChange="1"  />
        <TextBlock Canvas.Left="14" Canvas.Top="10" Height="21" Name="tbShadowDepth" Width="89"  Text="ShadowDepth" />


        <Slider AutoToolTipPlacement="BottomRight" AutoToolTipPrecision="1" Canvas.Left="100" Canvas.Top="38" Height="22"  
                  Value="{Binding ElementName=effecct,Path=Direction}"
                Interval="10" LargeChange="10" Maximum="360" Minimum="0" Name="sldDirection" Width="312" />
        <TextBlock Canvas.Left="14" Canvas.Top="37" Height="21" Name="tbDirection" Text="Direction" Width="70" />

        <Slider AutoToolTipPlacement="BottomRight" AutoToolTipPrecision="1" Canvas.Left="100" Canvas.Top="66"   
                 Value="{Binding ElementName=effecct,Path=Opacity}"
                Height="22"   LargeChange="0.1" Maximum="1" Minimum="0" Name="sldOpacity" Width="312" />
        <TextBlock Canvas.Left="14" Canvas.Top="64" Height="21" Name="tbOpacity" Text="Opacity" Width="70" />

        <Slider AutoToolTipPlacement="BottomRight" AutoToolTipPrecision="1" Canvas.Left="98" Canvas.Top="94"  
                 Value="{Binding ElementName=effecct,Path=Softness}"
                Height="22" LargeChange="0.1" Maximum="1" Minimum="0" Name="sldSoftness" Width="312" />
        <TextBlock Canvas.Left="14" Canvas.Top="91" Height="21" Name="tbSoftness" Text="Softness" Width="70" />

        <Label Canvas.Left="14" Canvas.Top="150" Height="28" Name="lblColor" Width="388"  Background="#FF0000"
               BorderBrush="Black" BorderThickness="1" Foreground="Black" >Click to select Color</Label>
        
        <TextBlock Canvas.Left="14" Canvas.Top="120" Height="21" Name="textBlock1" Text="Noise" Width="89" />

        <Slider AutoToolTipPlacement="BottomRight" AutoToolTipPrecision="1" Canvas.Left="98" Canvas.Top="120" Height="22" LargeChange="0.1" 
                Maximum="1" Minimum="0" Name="slider1" Value="{Binding ElementName=effecct, Path=Noise}" Width="312" />

        <Image Canvas.Left="491" Canvas.Top="16" Height="150" Name="image2" Stretch="Fill" Width="160"      Source="images/1.png" >
            <Image.BitmapEffect>
                <DropShadowBitmapEffect  x:Name="effecct" ShadowDepth="9.2857142857142811"
                                         Color="#FFFF0000" Direction="268.35215946843863" Noise="0" 
                                         Opacity="0.55747508305647842" Softness="0.66943521594684374" />
            </Image.BitmapEffect>
            
        </Image>
        <TextBlock Canvas.Left="503" Canvas.Top="200" Height="47" Name="textBlock2"   Text="测试字" FontSize="25" Width="181"    >   
              <TextBlock.BitmapEffect>
                <DropShadowBitmapEffect    Noise="{Binding ElementName=effecct,Path=Noise,Mode=OneWay}"
                                           Softness="{Binding ElementName=effecct,Path=Softness,Mode=OneWay}"  
                                           Color="{Binding ElementName=effecct,Path=Color,Mode=OneWay}" 
                                           Direction="{Binding ElementName=effecct,Path=Direction,Mode=OneWay}" 
                                           Opacity="{Binding ElementName=effecct,Path=Opacity,Mode=OneWay}"  
                                           ShadowDepth="{Binding ElementName=effecct,Path=ShadowDepth,Mode=OneWay}" />
            </TextBlock.BitmapEffect>
        </TextBlock>
        <TextBox Canvas.Left="14" Canvas.Top="200" Height="78" Name="textBox1" Width="398"    TextWrapping="Wrap" >
            
        </TextBox>
      
    </Canvas>
</Page>
